'----------------------------------------------
' Name: Ali Karbassi & Ben Sattler
' Date: February 15, 2007
' Description: Program 2
'              Class Chicago
'----------------------------------------------
Public Class Chicago
   Inherits House

   ''' <summary>
   ''' Constructor
   ''' </summary>
   ''' <remarks></remarks>
   Sub New()
      _PriceSet = False
      theCount += 1
   End Sub

   ''' <summary>
   ''' Returns House Type
   ''' </summary>
   ''' <value></value>
   ''' <returns></returns>
   ''' <remarks></remarks>
   Public Overrides ReadOnly Property Type() As String
      Get
         Return "Chicago"
      End Get
   End Property

   ''' <summary>
   ''' Sets the rooms. Displays errors if not in the range or selected.
   ''' </summary>
   ''' <remarks></remarks>
   Public Overrides Sub setRooms()

      If Rooms < 2 Or Rooms > 4 Then
         Err.Raise(33401, "rooms", "Must select number of rooms.")
      ElseIf Rooms <> 3 And Rooms <> 4 Then
         Err.Raise(33402, "rooms", "Number of rooms out of range.")
      End If

   End Sub

   ''' <summary>
   ''' Sets the garages. Displays errors if not in the range or selected.
   ''' </summary>
   ''' <remarks></remarks>
   Public Overrides Sub setGarages()

      If Garages <> 2 And Garages <> 3 Then
         Err.Raise(33403, "garages", "Number of garages out of range.")
      End If

   End Sub

   ''' <summary>
   ''' Sets the price. Raises event if ID has been changed.
   ''' </summary>
   ''' <remarks></remarks>
   Public Overrides Sub setPrice()

      Dim temp As Double = Price

      _Price = 300000

      If Rooms = 4 Then
         _Price += 40000
      End If

      If Garages = 3 Then
         _Price += 5000
      End If

      If _PriceSet = True And Not temp = _Price Then
         HasChanged(ID)
      Else
         _PriceSet = True
      End If


   End Sub

End Class
